package com.ojoin.trade.common_core.web.dao.impl;

import com.ojoin.trade.common.exception.BusinessException;
import com.ojoin.trade.common.exception.DaoException;
import org.apache.ibatis.session.SqlSession;
import org.springframework.stereotype.Repository;

import com.ojoin.trade.common.web.dao.impl.BaseDaoImpl;
import com.ojoin.trade.common_core.web.dao.TbFactoringCompanyDao;
import com.ojoin.trade.common_core.web.domain.TbFactoringCompany;

@Repository
public class TbFactoringCompanyDaoImpl extends BaseDaoImpl<TbFactoringCompany> implements TbFactoringCompanyDao {
	
	public SqlSession getSqlSession() {
		return this.sqlSessionTemplate;
	}

    @Override
    public Integer getCompanyByjoind(int joinid) throws BusinessException {
        String mapMethodName = "selectcompanyid";
        try {
            return sqlSessionTemplate.selectOne(mapMethodName,joinid);
        } catch (Exception e) {
            throw new DaoException(String.format("查询对象列表出错！语句：%s",
                    getSqlName(mapMethodName)), e);
        }
    }

}
